Klasse JsonSummaryPresenter

java.lang.Object
com.inet.pdfc.presenter.BasePresenter
com.inet.pdfc.presenter.JsonSummaryPresenter
Alle implementierten Schnittstellen:
NamedExtension

public class JsonSummaryPresenter extends BasePresenter
This presenter creates a summarized JSON result for single and batch comparisons.
Seit:
i-net PDFC 24.10
  • Konstruktordetails

    • JsonSummaryPresenter

      public JsonSummaryPresenter(@Nonnull File rootFolder)
      Creates the presenter with an export target in the root folder
      Parameter:
      rootFolder - the root folder to store the JSON file to
      Seit:
      i-net PDFC 24.10
    • JsonSummaryPresenter

      public JsonSummaryPresenter(@Nonnull com.inet.lib.io.SupplierWithIOException<OutputStream> streamProvider)
      Creates the presenter with a custom export target
      Parameter:
      streamProvider - the provider to get the stream to write the summary to
      Seit:
      i-net PDFC 24.10
  • Methodendetails

    • onComparisonDone

      public void onComparisonDone() throws Exception
      Called to indicate that a comparison has finished. This does not imply that any page data or differences are available.
      Angegeben von:
      onComparisonDone in Klasse BasePresenter
      Löst aus:
      Exception - thrown in case the processing of the finish step fails
    • onFinish

      public void onFinish()
      OPTIONAL: Called in case of batch comparison at the end of all comparisons of the batch run. This method cannot be triggered by an event of any referenced result model. It's sole purpose is to serve as a callback for the PDFComparer.batchCompare(java.io.File, java.io.File) method.
      NOTE: This method only called once per batch compare and only for the root presenter, never for spawned ones.
      Setzt außer Kraft:
      onFinish in Klasse BasePresenter
    • getJson

      public @Nonnull String getJson()
      Returns the summary result as Json
      Gibt zurück:
      the summary result as Json@since i-net PDFC 25.10
    • onError

      public void onError(ExceptionData error, boolean interrupted, BasePresenter.ERROR_SOURCE source)
      Called in case of an error that occurred either in one of the parser threads or in the compare thread.
      NOTE: This method is only called for exceptions which are notified to the ResultModel.
      Setzt außer Kraft:
      onError in Klasse BasePresenter
      Parameter:
      error - the exception
      interrupted - indicates whether the comparison was interrupted due to this exception. If true there will be no further calls (e.g. onComparisonDone)
      source - the source module of the exception.
    • onInit

      public void onInit() throws Exception
      Called at the time the document informations have been set.
      Setzt außer Kraft:
      onInit in Klasse BasePresenter
      Löst aus:
      Exception - thrown in case the processing of the init step fails
    • spawn

      public BasePresenter spawn(boolean spawnWithParent)
      Creates another presenter of the the same type as the current one. The spawned presenter may either have the same settings as the current one or it may be a child of the current one.
      Setzt außer Kraft:
      spawn in Klasse BasePresenter
      Parameter:
      spawnWithParent - if true, the presenter is allowed to keep a reference to it's parent to create a summary on onFinish()
      Gibt zurück:
      a new presenter for the same batch comparison run as the current one
    • getExtensionName

      public @Nonnull String getExtensionName()
      Returns the UNIQUE name of the extension. With UNIQUE referring to 'unique among all implementations of the same interface'
      Gibt zurück:
      the UNIQUE name of the extension
    • getExportFileName

      public @Nonnull String getExportFileName()
      Returns the default export file name, consisting of the input folders and the total number of comparisons
      Gibt zurück:
      the default export file name
      Seit:
      i-net PDFC 24.10